package com.JDK新特性;

import java.util.*;
import java.util.function.Predicate;

public class Lambda表达式
{
    public static void main(String[] args) throws InterruptedException
    {
        List<Integer>  list = new ArrayList<Integer>();
        list.add(50);
        list.add(18);
        list.add(6);
        list.add(99);
        list.add(32);
        System.out.println("排序前：" + list);
        LambdaTest3 lt3 = Collections::sort;
        lt3.sort(list,(a,b)->{
            return a-b;
        });
        Predicate<Boolean> nonNull = Objects::nonNull;
        System.out.println("排序后：" + list);
    }
}

 interface LambdaTest{
    abstract void print();
}

 interface DefalutTest {

    static int a =5;
    default void defaultMethod(){
        System.out.println("DefalutTest defalut 方法");
    }

    int sub(int a,int b);

    static void staticMethod() {
        System.out.println("DefalutTest static 方法");
    }
}

interface LambdaTest3 {

    abstract void sort(List<Integer> list, Comparator<Integer> c);
}
